/*
 * Copyright (c) 2021. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.xxpure.Point;

import java.util.ArrayList;
import java.util.Random;

/**
 * @program: KNN
 * @author: Mr.xiao
 * @email: 1347772729@qq.com
 * @create: 2021-07-04 16:37
 **/

public class PointFactory {
    private final int bound;
    private final int sampleNumber;

    public PointFactory(int bound, int sampleNumber) {
        this.bound = bound;
        this.sampleNumber = sampleNumber;
    }

    public ArrayList<MyPoint> getInitialData() {
        ArrayList<MyPoint> initialData = new ArrayList<>();
        var random = new Random();
        for (int i = 1; i <= sampleNumber; i++) {
            initialData.add(new MyPoint(random.nextInt(bound), random.nextInt(bound)));
        }
        return initialData;
    }
}